<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>《JavaScript高级程序设计（第三版）》Page163页的源码</title>
<link href="" rel="stylesheet">
</head>
<body>
    <script type="text/javascript">
    function SuperType(){
        this.property = "我是父亲的属性";
    }
    SuperType.prototype.getSuperValue = function(){
        return this.property;
    }
    function SubType(){
        this.subproperty = "我是孩子的属性";
    }
    SubType.prototype = new SuperType(); 
    SubType.prototype.getSubValue = function(){
        return this.subproperty;
    }
    var instance = new SubType();　　
    alert(instance.getSuperValue());//我是父亲的属性
</script>
</body>
</html>